package Algorithm.Othes;
// https://leetcode-cn.com/problems/count-numbers-with-unique-digits/
public class
Leetcode375_统计各位数字都不同的数字个数 {
    class Solution {
        public int countNumbersWithUniqueDigits(int n) {
            if(n == 0){
                return 1;
            }

            int res = 10;
            int cur = 9;

            for(int i = 0; i< n-1; i++){
                cur = cur * (9 - i);
                res = res + cur;
            }

            return res;
        }
    }
}
